﻿using System;

namespace BCC.Common
{
    public class LogHelper
    {
        public static readonly log4net.ILog inforLog = log4net.LogManager.GetLogger("LogFileAppender");

        //public static readonly log4net.ILog errorLog = log4net.LogManager.GetLogger("ErrorLog");

        /// <summary>
        /// 记录普通日志
        /// </summary>
        /// <param name="content">内容</param>
        public static void Info(string content)
        {
            if (inforLog.IsInfoEnabled)
            {
                inforLog.Info(content);
            }
        }

        /// <summary>
        /// 记录错误日志
        /// </summary>
        /// <param name="content">内容</param>
        /// <param name="ex">异常实例</param>
        public static void Error(string content, Exception ex)
        {
            if (inforLog.IsErrorEnabled)
            {
                inforLog.Error(content, ex);
            }
        }
    }
}
